<template>
	<view class="homepage friend_Page">
		<headerinfo></headerinfo>
		<homeindex ref="homeindex" v-if="tabIndex == 0"></homeindex>
		<fabu v-if="tabIndex == 1"></fabu>
		<mine ref="mine" v-if="tabIndex == 2"></mine>
		<tabbar @changeIndex="changeIndex"/>
	</view>
	
</template>

<script>
	import homeindex from './index.vue'
	import fabu from './fabu.vue'
	import mine from './mine.vue'
	import tabbar from './components/tabbar.vue'
	export default {
		components: {tabbar,homeindex,fabu,mine},
		data() {
			return {
				tabIndex:0
			};
		},
		onShow() {
			// console.log('home onShow',this.tabIndex);
			// if(this.tabIndex == 2){
			// 	this.$refs.mine.getData()
			// 	this.$refs.mine.gettongji()
			// 	this.$refs.mine.messagenum()
			// }else if(this.tabIndex == 0){
				
			// 	let dianzan = uni.getStorageSync('dianzan')?uni.getStorageSync('dianzan'):''
			// 	let guanzhu = uni.getStorageSync('guanzhu')?uni.getStorageSync('guanzhu'):''
			// 	let shoucang = uni.getStorageSync('shoucang')?uni.getStorageSync('shoucang'):''
				
			// 	if(dianzan){
			// 		this.$refs.homeindex.setdianzan(dianzan)
			// 	}
			// 	if(guanzhu){
			// 		this.$refs.homeindex.setguanzhu(guanzhu)
			// 	}
				
			// 	if(shoucang){
			// 		this.$refs.homeindex.setshoucang(shoucang)
			// 	}
				
				
			// }
		},
		onLoad() {
			// console.log('pagefriend home onLoad');
		},
		// onReachBottom(){
		//     console.log('触底了！')
		// 	if(this.tabIndex == 0){
		// 		this.$refs.homeindex.getData()
		// 	}
		// },
		methods: {
			changeIndex(index){
				this.tabIndex = index
				
				if(this.tabIndex == 2){
					this.$refs.mine.messagenum()
				}
			}
		}
	};
</script>


<style>
	page{
		height: 100vh;
		background-color: #fff!important;
		overflow-y: scroll;
	}
</style>

<style lang="scss" scoped>
	
</style>